import request from '@/utils/request'

// 查询分享文档列表
export function listDoc(query) {
  return request({
    url: '/prt/sharedoc/list',
    method: 'get',
    params: query
  })
}

// 查询分享文档详细
export function getDoc(docId) {
  return request({
    url: '/prt/sharedoc/' + docId,
    method: 'get'
  })
}

// 新增分享文档
export function addDoc(file,filename) {
  return request({
    url: '/prt/sharedoc/addFile/' + filename,
    method: 'post',
    data:file
  })
}





// 修改分享文档
export function updateDoc(data) {
  return request({
    url: '/prt/sharedoc',
    method: 'put',
    data: data
  })
}

// 删除分享文档
export function delDoc(docId) {
  return request({
    url: '/prt/sharedoc/' + docId,
    method: 'delete'
  })
}

//后端分享文档
export function shareDoc(file,filename) {
  return request({
    url: '/prt/sharedoc/addFile/' + filename,
    method: 'post',
    data:file
  })
}

// 导出分享文档
export function exportDoc(query) {
  return request({
    url: '/prt/sharedoc/export',
    method: 'get',
    params: query
  })

}

export function uploadFile() {
  return request({
    url: '/prt/sharedoc/export',
    method: 'get',
    params: query
  })

}
